/*
 * Write a C++ program to print
 * the series 1, 2, 4, 7, 11, 16, 22, 27
 */

# include <iostream>
using namespace std;

class SeqPrinter {
	int i;
public:
	void getSeqLength();
	void printSeq();
};

void SeqPrinter::getSeqLength() {
	cout << "Enter the sequence length: ";
	cin >> i;
}

void SeqPrinter::printSeq() {
	int j, k = 1;
	for(j = 1; j < i; j++) {
		cout << k << ", ";
		k += j;
	}
}

int main() {
	SeqPrinter sp;
	sp.getSeqLength();
	sp.printSeq();
}
